export default function reducer(state={
    messages:"",
    token:"",
    userInfo:null
},action){
    switch(action.type){
        case "initUser":
            return {
                ...state,
                token:action.payload.token,
                userInfo:action.payload.user,
                messages:action.payload.messages
            }
        default:
            return state
    }
}